$(function () {
    let id=localStorage.getItem("companyid");
    findById(id);
})
function findById(id) {
    let data=myAjax("/back/producat/companyfindById",{id:id},"get");
    setData(data.companyModel);
}
function setData(data) {
    // let id=localStorage.getItem("companyid");
    $("#showlogo").attr("src", data.logo);
    $("#email").val(data.email);
    $("#hotline").val(data.hotline);
    $("#address").val(data.address);
    $("#phone").val(data.phone);
    $("#tel").val(data.tel);
    $("#landline").val(data.landline);
}

function companyuapdate() {
    let data=new FormData();// let data=new FormData()传文件
    data.append("logo",$("#logo")[0].files[0]);
    data.append("email",$("#email").val());
    data.append("hotline",$("#hotline").val());
    data.append("address",$("#address").val());
    data.append("phone",$("#phone").val());
    data.append("tel",$("#tel").val());
    data.append("landline",$("#landline").val());
    let da=myAjaxTwo("/back/producat/companyUpdate",data,"post");
    if (da.count==1){
        alert("修改成功");
        $('#reght').load('/back/company/companyfandAll.html')
    }else {
        alert("修改失败");
    }
}